﻿@using BlueLotus7.Eden.KB.Models;
@using BlueLotus7.ArchiveSystem.Common;
@using BlueLotus7.Eden.Web;
@model DomainScopeGuidControlModel
@{
    if (Model != null)
    {
  
    <text>
    <table id="scopeGrid" cellpadding="0" cellspacing="0" class="bluelotus7-grid">
        <thead>
            <tr>
                <th class="identity"></th>
                <th class="name">Name </th>
                <th class="code">Code </th>
                <th class="is-social">Is Social </th>
                <th class="is-im">Is IM </th>
                <th class="description">Description </th>
                <th class="action"></th>
            </tr>
        </thead>
        <tbody>
            @{
        foreach (var item in Model.DomainScopes)
        {           
                <text>
                <tr>
                    <th class="identity">
                        @(item.Key.ToString())
                    </th>
                    <td class="name"><a target="_blank" href="@(Url.Action("ViewScope", "DomainScope", new { area = "Management", key = item.Key }))">@(Helper.ConvertToDisplayString(item.Name))
                    </a></td>
                    <td class="code">
                        @(Helper.ConvertToDisplayString(item.Code))
                    </td>
                    <td class="is-social">
                        @(Helper.ConvertToDisplayString(((int)item.Type & (int)DomainScopeType.SociatySite) > 0))
                    </td>
                    <td class="is-im">
                        @(Helper.ConvertToDisplayString(((int)item.Type & (int)DomainScopeType.IM) > 0))
                    </td>
                    <td class="description">
                        @(Helper.ConvertToDisplayString(item.Description))
                    </td>
                    <td class="action"><a target="_blank" href="@(Url.Action("Users", "DomainScope", new { area = "Management", key = item.Key }))">
                        View Users</a>
                        @{
            if (Model.ShowIMLink && (((int)item.Type & (int)DomainScopeType.IM) > 0))
            {
                            <text> <a target="_blank" href="@(Url.Action("IMScopeUsers", "DomainScope", new { area = "Management", key = item.Key }))">
                                Manage IM Users</a>
                            </text>
            }
                        }
                    </td>
                </tr>
                </text>
        }
            }
        </tbody>
    </table>
    </text>

    }  
}
